package C07.List01;
import java.util.ArrayList;
public class ArrayListUse02 {
    public static void main(String[] args) {
        ArrayList<String> listStrings = new ArrayList<>();
        listStrings.add("张三");
        listStrings.add("张三22");
        listStrings.add("李四");

        for (int i = 0; i < listStrings.size(); i++) {
            System.out.println(listStrings.get(i));
        }

        System.out.println("-----------------");
        for (String s : listStrings) {
            System.out.println(listStrings.indexOf(s) +
                    "-----" + s);
        }
    }



}
